from pydantic import BaseModel
from datetime import datetime

class MindMapBase(BaseModel):
    user_id: int
    material_id: int
    mind_map_json: str

class MindMapCreate(MindMapBase):
    pass

class MindMapUpdate(BaseModel):
    user_id: int = None
    material_id: int = None
    mind_map_json: str = None

class MindMapInDBBase(MindMapBase):
    id: int
    version: int
    updated_at: datetime

    class Config:
        from_attributes = True

class MindMap(MindMapInDBBase):
    pass

class MindMapInDB(MindMapInDBBase):
    pass
